#ifndef __CLASS_STATUSLAMP_H__
#define __CLASS_STATUSLAMP_H__

#include "BaseLamp.h"
#include <stdint.h>
// #include <ExpiryTimer.h>

class StatusLamp : public BaseLamp<StatusLamp>
{
public:
    enum emST
    {
        _ST_STOP,           //常灭
        _ST_LOOKUP_NETWORK, //三闪
        _ST_RUNNING,        //单闪
        _ST_ERROR,          //三短三长
        _ST_WIFI_CONFIG,    // 一长一短
        _ST_SYNC_NTP,       //
    };

    emST _state;

public:
    StatusLamp(uint32_t pin);
    virtual ~StatusLamp();
    void setSt(emST state = _ST_STOP);
    bool Run();

private:
    class TaskLookUp : public BaseLamp<TaskLookUp>
    {
    private:
        // ExpiryTimer _ex_timer;
        uint i;

    public:
        TaskLookUp(uint32_t pin) : BaseLamp(pin) {}
        bool Run();
    };

    class TaskRunning : public BaseLamp<TaskRunning>
    {
    private:
        // ExpiryTimer _ex_timer;
    public:
        TaskRunning(uint32_t pin) : BaseLamp(pin) {}
        bool Run();
    };

    class TaskError : public BaseLamp<TaskError>
    {
    private:
        // ExpiryTimer _ex_timer;
        uint i;

    public:
        TaskError(uint32_t pin) : BaseLamp(pin) {}
        bool Run();
    };

    class TaskWifiConfig : public BaseLamp<TaskWifiConfig>
    {
    private:
        // ExpiryTimer _ex_timer;
        uint i;

    public:
        TaskWifiConfig(uint32_t pin) : BaseLamp(pin) {}
        bool Run();
    };

    class TaskSyncNtp : public BaseLamp<TaskWifiConfig>
    {
    private:
        uint i;

    public:
        TaskSyncNtp(uint32_t pin) : BaseLamp(pin) {}
        bool Run();
    };

    TaskLookUp taskLookUp;
    TaskRunning taskRunning;
    TaskError taskError;
    TaskWifiConfig taskWifiConfig;
    TaskSyncNtp taskSyncNtp;
};

extern StatusLamp stLamp;

#endif //!__CLASS_STATUSLAMP_H__